<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>系统设置 - 加强附魔金苹果模组</title>
    
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    
    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
    <link href="css/admin-style.css" rel="stylesheet">
</head>
<body>
    <div class="admin-layout">
        <!-- 侧边栏 -->
        <nav class="admin-sidebar">
            <div class="sidebar-header">
                <img src="images/logo-small.svg" alt="管理员面板" class="sidebar-logo">
                <h3>管理面板</h3>
            </div>
            
            <ul class="sidebar-menu">
                <li class="menu-item">
                    <a href="admin-dashboard.html">
                        <i class="fas fa-chart-pie"></i>
                        <span>仪表板</span>
                    </a>
                </li>
                <li class="menu-item">
                    <a href="admin-feedback.html">
                        <i class="fas fa-comments"></i>
                        <span>反馈管理</span>
                        <span class="badge" id="feedbackCount">0</span>
                    </a>
                </li>
                <li class="menu-item active">
                    <a href="admin-settings.html">
                        <i class="fas fa-cog"></i>
                        <span>系统设置</span>
                    </a>
                </li>
                <li class="menu-divider"></li>
                <li class="menu-item">
                    <a href="index.html">
                        <i class="fas fa-external-link-alt"></i>
                        <span>返回网站</span>
                    </a>
                </li>
                <li class="menu-item">
                    <a href="#" onclick="logout()">
                        <i class="fas fa-sign-out-alt"></i>
                        <span>退出登录</span>
                    </a>
                </li>
            </ul>
        </nav>

        <!-- 主内容区域 -->
        <main class="admin-main">
            <!-- 顶部导航 -->
            <header class="admin-header">
                <div class="header-left">
                    <button class="sidebar-toggle" onclick="toggleSidebar()">
                        <i class="fas fa-bars"></i>
                    </button>
                    <h1>系统设置</h1>
                </div>
                <div class="header-right">
                    <div class="header-notification">
                        <i class="fas fa-bell"></i>
                        <span class="notification-badge">3</span>
                    </div>
                    <div class="header-user">
                        <img src="images/admin-avatar.svg" alt="管理员" class="user-avatar">
                        <span>管理员</span>
                    </div>
                </div>
            </header>

            <!-- 设置内容 -->
            <div class="dashboard-content">
                <!-- 设置标签页 -->
                <div class="settings-tabs">
                    <div class="tab-nav">
                        <button class="tab-btn active" onclick="showTab('general')">
                            <i class="fas fa-cog"></i> 基本设置
                        </button>
                        <button class="tab-btn" onclick="showTab('appearance')">
                            <i class="fas fa-palette"></i> 外观设置
                        </button>
                        <button class="tab-btn" onclick="showTab('notification')">
                            <i class="fas fa-bell"></i> 通知设置
                        </button>
                        <button class="tab-btn" onclick="showTab('security')">
                            <i class="fas fa-shield-alt"></i> 安全设置
                        </button>
                        <button class="tab-btn" onclick="showTab('backup')">
                            <i class="fas fa-database"></i> 备份管理
                        </button>
                    </div>

                    <!-- 基本设置 -->
                    <div id="general" class="tab-content active">
                        <div class="settings-card">
                            <h3><i class="fas fa-info-circle"></i> 网站信息</h3>
                            <div class="setting-item">
                                <label for="siteName">网站名称</label>
                                <input type="text" id="siteName" placeholder="加强附魔金苹果模组">
                            </div>
                            <div class="setting-item">
                                <label for="siteDescription">网站描述</label>
                                <textarea id="siteDescription" rows="3" placeholder="为 Minecraft 1.21.8 提供强大的附魔金苹果功能"></textarea>
                            </div>
                            <div class="setting-item">
                                <label for="adminEmail">管理员邮箱</label>
                                <input type="email" id="adminEmail" placeholder="admin@example.com">
                            </div>
                            <div class="setting-item">
                                <label for="timezone">时区</label>
                                <select id="timezone">
                                    <option value="Asia/Shanghai">北京时间 (UTC+8)</option>
                                    <option value="America/New_York">纽约时间 (UTC-5)</option>
                                    <option value="Europe/London">伦敦时间 (UTC+0)</option>
                                </select>
                            </div>
                            <div class="setting-item">
                                <label for="language">默认语言</label>
                                <select id="language">
                                    <option value="zh-CN">简体中文</option>
                                    <option value="en-US">English</option>
                                </select>
                            </div>
                        </div>
                    </div>

                    <!-- 外观设置 -->
                    <div id="appearance" class="tab-content">
                        <div class="settings-card">
                            <h3><i class="fas fa-palette"></i> 主题设置</h3>
                            <div class="setting-item">
                                <label for="theme">主题模式</label>
                                <select id="theme">
                                    <option value="dark">深色主题</option>
                                    <option value="light">浅色主题</option>
                                </select>
                            </div>
                            <div class="setting-item">
                                <label for="primaryColor">主色调</label>
                                <input type="color" id="primaryColor" value="#4ade80">
                            </div>
                            <div class="setting-item">
                                <label for="backgroundColor">背景颜色</label>
                                <input type="color" id="backgroundColor" value="#0a0a0a">
                            </div>
                            <div class="setting-item">
                                <label>
                                    <input type="checkbox" id="enableAnimations" checked>
                                    启用动画效果
                                </label>
                            </div>
                            <div class="setting-item">
                                <label>
                                    <input type="checkbox" id="showLogo" checked>
                                    显示网站Logo
                                </label>
                            </div>
                            <div class="setting-item">
                                <label for="logoSize">Logo大小</label>
                                <select id="logoSize">
                                    <option value="small">小</option>
                                    <option value="medium">中</option>
                                    <option value="large">大</option>
                                </select>
                            </div>
                        </div>
                    </div>

                    <!-- 通知设置 -->
                    <div id="notification" class="tab-content">
                        <div class="settings-card">
                            <h3><i class="fas fa-bell"></i> 通知配置</h3>
                            <div class="setting-item">
                                <label>
                                    <input type="checkbox" id="emailNotifications" checked>
                                    启用邮件通知
                                </label>
                            </div>
                            <div class="setting-item">
                                <label>
                                    <input type="checkbox" id="newFeedbackNotification" checked>
                                    新反馈邮件通知
                                </label>
                            </div>
                            <div class="setting-item">
                                <label>
                                    <input type="checkbox" id="dailyReport">
                                    每日报告邮件
                                </label>
                            </div>
                            <div class="setting-item">
                                <label>
                                    <input type="checkbox" id="notificationSound" checked>
                                    通知声音
                                </label>
                            </div>
                            <div class="setting-item">
                                <label>
                                    <input type="checkbox" id="pushNotifications">
                                    推送通知
                                </label>
                            </div>
                            <div class="setting-actions">
                                <button class="btn btn-secondary" onclick="testEmailSettings()">
                                    <i class="fas fa-envelope"></i> 测试邮件设置
                                </button>
                            </div>
                        </div>
                    </div>

                    <!-- 安全设置 -->
                    <div id="security" class="tab-content">
                        <div class="settings-card">
                            <h3><i class="fas fa-shield-alt"></i> 安全配置</h3>
                            <div class="setting-item">
                                <label>
                                    <input type="checkbox" id="enableTwoFactor">
                                    启用双因素认证
                                </label>
                            </div>
                            <div class="setting-item">
                                <label for="sessionTimeout">会话超时 (分钟)</label>
                                <input type="number" id="sessionTimeout" value="30" min="5" max="120">
                            </div>
                            <div class="setting-item">
                                <label>
                                    <input type="checkbox" id="autoBackup" checked>
                                    自动备份
                                </label>
                            </div>
                            <div class="setting-item">
                                <label for="loginAttempts">登录尝试次数限制</label>
                                <input type="number" id="loginAttempts" value="5" min="3" max="10">
                            </div>
                            <div class="setting-item">
                                <label for="ipWhitelist">IP白名单 (每行一个)</label>
                                <textarea id="ipWhitelist" rows="3" placeholder="192.168.1.1&#10;10.0.0.1"></textarea>
                            </div>
                        </div>
                    </div>

                    <!-- 备份管理 -->
                    <div id="backup" class="tab-content">
                        <div class="settings-card">
                            <h3><i class="fas fa-database"></i> 备份配置</h3>
                            <div class="setting-item">
                                <label for="autoBackupInterval">自动备份间隔 (小时)</label>
                                <input type="number" id="autoBackupInterval" value="24" min="1" max="168">
                            </div>
                            <div class="setting-item">
                                <label for="backupRetention">备份保留天数</label>
                                <input type="number" id="backupRetention" value="7" min="1" max="30">
                            </div>
                            <div class="setting-item">
                                <label for="backupLocation">备份位置</label>
                                <select id="backupLocation">
                                    <option value="local">本地存储</option>
                                    <option value="cloud">云存储</option>
                                </select>
                            </div>
                            <div class="setting-item">
                                <label>
                                    <input type="checkbox" id="encryptBackups" checked>
                                    加密备份文件
                                </label>
                            </div>
                            <div class="setting-item">
                                <label for="cloudBackupProvider">云存储提供商</label>
                                <select id="cloudBackupProvider">
                                    <option value="none">无</option>
                                    <option value="aws">Amazon S3</option>
                                    <option value="google">Google Drive</option>
                                    <option value="onedrive">OneDrive</option>
                                </select>
                            </div>
                            <div class="setting-actions">
                                <button class="btn btn-primary" onclick="createBackup()">
                                    <i class="fas fa-save"></i> 立即备份
                                </button>
                                <button class="btn btn-secondary" onclick="restoreBackup()">
                                    <i class="fas fa-upload"></i> 恢复备份
                                </button>
                            </div>
                        </div>
                    </div>

                    <!-- 操作按钮 -->
                    <div class="settings-actions">
                        <button class="btn btn-primary" onclick="saveSettings()">
                            <i class="fas fa-save"></i> 保存设置
                        </button>
                        <button class="btn btn-secondary" onclick="exportSettings()">
                            <i class="fas fa-download"></i> 导出设置
                        </button>
                        <button class="btn btn-secondary" onclick="importSettings()">
                            <i class="fas fa-upload"></i> 导入设置
                        </button>
                        <button class="btn btn-warning" onclick="resetSettings()">
                            <i class="fas fa-undo"></i> 重置设置
                        </button>
                    </div>
                </div>
            </div>
        </main>
    </div>

    <style>
        /* 设置页面特定样式 */
        .settings-tabs {
            background: rgba(255, 255, 255, 0.03);
            border-radius: 20px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(20px);
            overflow: hidden;
        }

        .tab-nav {
            display: flex;
            background: rgba(255, 255, 255, 0.05);
            padding: 20px;
            gap: 10px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            flex-wrap: wrap;
        }

        .tab-btn {
            padding: 12px 20px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 10px;
            color: rgba(255, 255, 255, 0.7);
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 0.9rem;
            font-weight: 500;
        }

        .tab-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #4ade80;
        }

        .tab-btn.active {
            background: linear-gradient(135deg, #4ade80, #06b6d4);
            color: white;
            border-color: transparent;
        }

        .tab-content {
            display: none;
            padding: 30px;
        }

        .tab-content.active {
            display: block;
            animation: fadeIn 0.3s ease;
        }

        .settings-card {
            background: rgba(255, 255, 255, 0.02);
            border-radius: 15px;
            padding: 25px;
            border: 1px solid rgba(255, 255, 255, 0.05);
            margin-bottom: 20px;
        }

        .settings-card h3 {
            color: #fff;
            font-size: 1.2rem;
            font-weight: 600;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .settings-card h3 i {
            color: #4ade80;
        }

        .setting-item {
            margin-bottom: 20px;
        }

        .setting-item label {
            display: block;
            color: rgba(255, 255, 255, 0.8);
            margin-bottom: 8px;
            font-weight: 500;
        }

        .setting-item input,
        .setting-item select,
        .setting-item textarea {
            width: 100%;
            padding: 12px 15px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            color: white;
            font-size: 14px;
            transition: all 0.3s ease;
        }

        .setting-item input:focus,
        .setting-item select:focus,
        .setting-item textarea:focus {
            outline: none;
            border-color: #4ade80;
            box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
        }

        .setting-item input[type="checkbox"] {
            width: auto;
            margin-right: 8px;
        }

        .setting-item input[type="color"] {
            width: 80px;
            height: 40px;
            padding: 5px;
            cursor: pointer;
        }

        .setting-actions {
            display: flex;
            gap: 15px;
            margin-top: 20px;
            flex-wrap: wrap;
        }

        .settings-actions {
            display: flex;
            gap: 15px;
            justify-content: center;
            padding: 30px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            margin-top: 20px;
        }

        .btn {
            padding: 12px 24px;
            border: none;
            border-radius: 8px;
            font-weight: 600;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
            text-decoration: none;
        }

        .btn-primary {
            background: linear-gradient(135deg, #4ade80, #06b6d4);
            color: white;
        }

        .btn-secondary {
            background: rgba(255, 255, 255, 0.1);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .btn-warning {
            background: linear-gradient(135deg, #f59e0b, #d97706);
            color: white;
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .tab-nav {
                flex-direction: column;
            }

            .settings-actions {
                flex-direction: column;
                align-items: center;
            }

            .setting-actions {
                flex-direction: column;
            }
        }
    </style>

    <script src="js/admin-settings.js"></script>
</body>
</html>